from django.db import models

# Create your models here.


class userinfo(models.Model):
    uid = models.CharField(max_length=10, verbose_name='用户名', help_text='用户名由英文字母,数字等字符组成')

    password = models.CharField(max_length=6, verbose_name='密码', help_text='登录密码由6~8字符组成')

    email = models.CharField(max_length=30, verbose_name='Email', help_text='有校电子邮件地址')

    def __str__(self):
        return self.uid

    @classmethod
    def createUserinfo(cls, gname, gdate, ggirlnum, gboynum, isDelete=False):
        grade = cls(gname=gname)
        return grade

    def __str__(self):
        return self.password

    @classmethod
    def createPassword(cls, gname, gdate, ggirlnum, gboynum, isDelete=False):

        grade = cls(gname=gname)
        return grade

    def __str__(self):
        return self.email

    @classmethod
    def createEmail(cls, gname, gdate, ggirlnum, gboynum, isDelete=False):
        grade = cls(gname=gname)
        return grade


class Grades (models.Model):
    gname = models.CharField (max_length=20, verbose_name='班级名')

    def __str__(self):
        return self.gname

    @classmethod
    def createGrade(cls, gname, gdate, ggirlnum, gboynum, isDelete=False):
        grade = cls(gname=gname)
        return grade


class Students (models.Model):
    sname = models.CharField(max_length=20)

    def __str__(self):
        return self.sname

    @classmethod
    def createStudent(cls, name):
        stu = cls ()
        stu.sname = name
        return stu